#define _CRT_SECURE_NO_WARNINGS 1
#include"Sort.h"


void TestBubble()
{
	int a[] = { 2,19,38,28,33,22,18,29,3,5,77,3 };
	BubbleSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestSelect()
{
	int a[] = { 2,19,38,28,33,22,18,29,3,5,77,3 };
	SelectSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestInsert()
{
	int a[] = { 2,19,38,28,33,22,18,29,3,5,77,3 };
	InsertSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestShell()
{
	int a[] = { 2,19,38,28,33,22,18,29,3,5,77,3 };
	ShellSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestHeap()
{
	int a[] = { 2,19,38,28,33,22,18,29,3,5,77,3 };
	HeapSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestQuckily()
{
	int a[] = { 2,19,38,28,33,22,18,29,3,5,77,3 };
	//QuckilySort(a, 0, sizeof(a)/sizeof(a[0]) - 1);
	QuckilySortNonR(a, 0, sizeof(a) / sizeof(a[0]) - 1);
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestMerge()
{
	int a[] = { 2,19,38,28,33,22,18,29,3,5,77,3,8 };
	//MergeSort(a, 0, sizeof(a) / sizeof(a[0]) - 1);
	MergeSort2(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestCount()
{
	int a[] = { 2,19,38,28,33,22,18,29,3,5,77,3,8 };
	CountSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

int main()
{
	//TestBubble();
	//TestSelect();
	//TestInsert();
	//TestShell();
	//TestHeap();
	//TestQuckily();
	//TestMerge();
	TestCount();
	return 0;
}